<template>
  <div>
    <rich-text :nodes="nodes"></rich-text>
  </div>
</template>
<script>
  import parser from 'rich-text-parser'
  import html from './html.js'
  export default {
    data() {
      return {
        nodes: null
      }
    },
    methods: {},
    mounted() {
      // 定义需要解析的特殊标签，value不填默认是div
      parser.definedCustomTag({ figure: 'div', figcaption: '' })
      const nodes = parser.getRichTextJson(html.html)
      this.nodes = nodes.children
    }
  }
</script>
<style type="text/css" lang="scss">
  .kai-images {
    .rich-img {
      max-width: 100%;
      max-height: 100px;
    }
  }
</style>
